import React from 'react';
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
import Layout from './components/Layout/Layout';
import NotebookView from './components/Notebook/NotebookView';
import ReviewView from './components/Review/ReviewView';
import 'bootstrap-icons/font/bootstrap-icons.css';
import './App.css';

const App: React.FC = () => {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Layout />}>
          {/* index route，默认子路由，重定向到/notebook/1，index一般和replace=true一起搭配使用 */}
          <Route index element={<Navigate to="/notebook/1" replace />} />
          <Route path="notebook/:notebookId" element={<NotebookView />} />
          <Route path="review" element={<ReviewView />} />
        </Route>
      </Routes>
    </BrowserRouter>
  );
};

export default App; 